<template>
  <div id="app">
    <HelloWorld msg="Welcome to Your Vue.js App"/>
  </div>
</template>

<script>
import HelloWorld from './components/HelloWorld.vue'
// import { mapState } from 'vuex'

export default {
  name: 'App',
  components: {
    HelloWorld
  },
  created: function(){
    console.log(this.$store)
    console.log(this.$store.state.products.count)
    // this.$store.commit('incrementserc',10)
    // this.$store.dispatch('incrementacions')
    
    // setTimeout(()=>{
    //   this.$store.dispatch('incrementsercactions',20)
    // },1000)
    console.log(this.$store.state.products.users.count)
    console.log({...this.$store.getters.doneTodos[1]})
    // this.$store.commit({
    //       type : 'use_incrementcount',
    //       amount: '我是多么想爱你，但是 我知道我现在不配，对不起！放过我也 请放过你自己'
    //     })
    this.$store.dispatch({
      type: 'use_incremtcount'
    })
    setTimeout(()=>{
      console.log(this.$store.state.products.users.count)
    },1000)
    console.log(this.$store.state.products.users.count)
    // console.log(this.$store.state.products.count)
    // setTimeout(()=>{
    //   console.log(this.$store.state.products.count)
    // },2000)
    // console.log(this.$store.getters.doubleCount)
    setTimeout(() => {
      console.log(this.$store.state.mind)
    }, 5000);
  },
  computed:{
    // ...mapState('products',{
    //    products:  state => state.products
    // })
  }
}

</script>
